/*
 * Genotype.cpp
 *
 *  Created on: 04-01-2011
 *      Author: Piotr
 */

#include "biology/Genotype.hpp"
#include "utils/MathUtils.hpp"
#include "utils/Randomizer.hpp"

Genotype::Genotype()
{
	this->lifeIncreasingSpeed = Randomizer::nextFloat(0.1f, 0.2f);
	this->hungerIncreasingSpeed = Randomizer::nextFloat(0.05f, 0.8f);
	this->thirstIncreasingSpeed = Randomizer::nextFloat(0.05f, 1.0f);
	this->libidoIncreasingSpeed = Randomizer::nextFloat(0.0f, 0.4f);

	this->sightDistance = static_cast<int> (Randomizer::nextInt(40, 70));
	this->sightRange = static_cast<int> (Randomizer::nextInt(60, 170));
	this->maxMovementSpeed = static_cast<int> (Randomizer::nextInt(5, 50));
	this->maxAngularVelocity = static_cast<int> (Randomizer::nextInt(2, 25));

	carnivore = Randomizer::nextBool();
}

Genotype::Genotype(bool carnivore, float hungerIncreasingSpeed, float libidoIncreasingSpeed,
		float lifeIncreasingSpeed, float maxAngularVelocity, float maxMovementSpeed,
		float sightDistance, float sightRange) :
	hungerIncreasingSpeed(hungerIncreasingSpeed), libidoIncreasingSpeed(libidoIncreasingSpeed),
			lifeIncreasingSpeed(lifeIncreasingSpeed), maxAngularVelocity(maxAngularVelocity),
			maxMovementSpeed(maxMovementSpeed), sightDistance(sightDistance), sightRange(sightRange),
			carnivore(carnivore)
{

}

float Genotype::getLifeIncreasingSpeed() const
{
	return lifeIncreasingSpeed;
}

float Genotype::getHungerIncreasingSpeed() const
{
	return hungerIncreasingSpeed;
}

float Genotype::getThirstIncreasingSpeed() const
{
	return thirstIncreasingSpeed;
}

float Genotype::getLibidoIncreasingSpeed() const
{
	return libidoIncreasingSpeed;
}

float Genotype::getSightRange() const
{
	return sightRange;
}

float Genotype::getSightDistance() const
{
	return sightDistance;
}

float Genotype::getMaxMovementSpeed() const
{
	return maxMovementSpeed;
}

float Genotype::getMaxAngularVelocityInDegreeses() const
{
	return maxAngularVelocity;
}

bool Genotype::isCarnivore() const
{
	return carnivore;
}
